/* Mobile-specific styles */

/* General mobile optimizations */
.mobile {
  /* Adjust font sizes for better readability on small screens */
  font-size: 14px;

  /* Adjust padding and margins */
  .el-card {
    margin-bottom: 10px;

    .el-card__header {
      padding: 12px 15px;
    }

    .el-card__body {
      padding: 15px;
    }
  }

  /* Make tables responsive */
  .el-table {
    width: 100%;
    overflow-x: auto;

    th, td {
      white-space: nowrap;
      min-width: 80px;
    }
  }

  /* Adjust form elements */
  .el-form-item {
    margin-bottom: 15px;
  }

  .el-form-item__label {
    float: none;
    display: block;
    text-align: left;
    padding: 0 0 8px;
  }

  .el-form-item__content {
    margin-left: 0 !important;
  }

  /* Adjust buttons */
  .el-button {
    padding: 10px 15px;
  }

  /* Adjust dialogs */
  .el-dialog {
    width: 90% !important;
    margin-top: 10vh !important;
  }

  .el-dialog__header {
    padding: 15px;
  }

  .el-dialog__body {
    padding: 15px;
  }

  .el-dialog__footer {
    padding: 10px 15px;
  }

  /* Adjust pagination */
  .el-pagination {
    white-space: normal;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;

    .el-pagination__total,
    .el-pagination__sizes,
    .el-pagination__jump {
      margin-bottom: 10px;
    }
  }

  /* Order management specific styles */
  .order-container {
    .filter-container {
      flex-direction: column;

      .filter-item {
        margin-bottom: 10px;
        width: 100%;
      }
    }
  }

  /* Dashboard specific styles */
  .dashboard-container {
    .chart-wrapper {
      height: 300px !important;
    }

    .data-overview-card {
      margin-bottom: 15px;
    }
  }

  /* Ensure PC sidebar is completely hidden on mobile */
  .sidebar-container {
    display: none !important;
    width: 0 !important;
    overflow: hidden !important;
  }

  /* Ensure main container takes full width */
  .main-container {
    margin-left: 0 !important;
    width: 100% !important;
  }

  /* Specific styles for hideSidebar class */
  #app .hideSidebar .main-container {
    margin-left: 0 !important;
  }

  .hideSidebar .fixed-header {
    width: 100% !important;
  }

  /* Hide tags view container */
  .tags-view-container {
    display: none !important;
  }

  /* Adjust main content area top padding due to hidden tags view */
  .app-main {
    padding-top: 20px !important;
  }
}

/* Hide elements on mobile */
@media (max-width: 767px) {
  .hide-on-mobile {
    display: none !important;
  }

  /* Hide PC sidebar */
  .sidebar-container {
    display: none !important;
    width: 0 !important;
  }

  /* Hide tags view container */
  .tags-view-container {
    display: none !important;
  }

  /* Adjust app-main padding */
  .app-main {
    padding: 10px !important;
    padding-top: 20px !important;
  }

  /* Ensure hideSidebar class's main container has no left margin */
  #app .hideSidebar .main-container {
    margin-left: 0 !important;
    padding-top: 40px;
  }

  /* Ensure hideSidebar class's fixed header width is 100% */
  .hideSidebar .fixed-header {
    width: 100% !important;
  }

  /* Make filter sections collapsible */
  .filter-section {
    .filter-title {
      cursor: pointer;
    }

    .filter-content {
      max-height: 0;
      overflow: hidden;
      transition: max-height 0.3s ease;

      &.expanded {
        max-height: 1000px;
      }
    }
  }
}

/* Tablet specific adjustments */
@media (min-width: 768px) and (max-width: 1024px) {
  .tablet-adjustments {
    /* Tablet specific styles that don't affect mobile or desktop */
  }
}

/* 移动端全局样式 */

/* 移动端样式 */
@media screen and (max-width: 768px) {
  .mobile-only {
    display: block !important;
  }
  
  .desktop-only {
    display: none !important;
  }
  
  /* 修复日期选择器在移动端的显示问题 */
  .el-picker-panel {
    width: 90% !important;
    left: 5% !important;
  }
  
  .el-date-table {
    width: 100%;
  }
  
  .el-date-range-picker__content {
    width: 50% !important;
    box-sizing: border-box;
  }
  
  .el-date-range-picker__header {
    padding: 8px 5px !important;
  }
  
  .el-date-range-picker__header div {
    margin-right: 5px !important;
    margin-left: 5px !important;
  }
  
  .el-picker-panel__shortcut {
    padding: 0 10px !important;
    line-height: 28px !important;
  }
  
  .el-date-editor .el-range-separator {
    padding: 0 3px;
  }
  
  .el-date-editor .el-range-input {
    width: 42%;
  }
  
  .el-date-range-picker {
    width: 90% !important;
  }
  
  .el-picker-panel__sidebar {
    width: 110px !important;
  }
  
  .el-date-range-picker__content.is-left {
    border-right: 1px solid #e4e4e4;
  }
  
  /* 修复弹出层在移动端的显示问题 */
  .el-dialog {
    width: 90% !important;
    margin-top: 20vh !important;
  }
  
  /* 修复表单在移动端的显示问题 */
  .el-form-item__label {
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  
  /* 修复分页组件在移动端的显示问题 */
  .el-pagination {
    white-space: normal !important;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .el-pagination__sizes {
    margin-top: 10px;
  }
  
  /* 修复下拉菜单在移动端的显示问题 */
  .el-select-dropdown {
    width: auto !important;
    min-width: 80% !important;
    left: 10% !important;
  }
}

/* 桌面端样式 */
@media screen and (min-width: 769px) {
  .mobile-only {
    display: none !important;
  }
  
  .desktop-only {
    display: block !important;
  }
}
